package android.medicalcloud.com.yiapp.yilian.utils.net;



import android.medicalcloud.com.yiapp.base.utils.StringTools;
import android.medicalcloud.com.yiapp.yilian.configer.enums.HttpConfig;
import android.medicalcloud.com.yiapp.yilian.logic.UserController;
import android.medicalcloud.com.yiapp.yilian.utils.android.Common;
import android.os.Build;



import java.util.HashMap;
import java.util.Map;

/**
 * Created by Wesley on 2015/3/4.
 */
public class HeaderTools {
    /**
     * 根据不同 配置生成不同的
     *
     * @param
     * @return
     */

    public static HashMap<String, String> getHeaderByConfig(HttpConfig configParam, Map<String, Object> param) {


        HashMap hashMap = new HashMap();
        hashMap.put("Accept", "application/json");
        hashMap.put("device", Common.getHeaderDeviceInfo());
        String token = UserController.getInstance().userToken();
        if (!StringTools.isNullOrEmpty(token)){
            hashMap.put("userToken", token);
        }
        if (configParam.getType()==HttpConfig.loginOut.getType()||configParam.getType()==HttpConfig.ubBindPush.getType()){
            hashMap.put("userToken", UserController.getInstance().userTempleToken());
        }
        return hashMap;
    }
}
